{template header}

<div class="container">

<ol class="breadcrumb">
  <li><a href="{SITE_URL}">首页</a></li>
  <li><a href="{tsUrl('article')}">文档</a></li>
  <li class="active">{if $strGroup}<a href="{tsUrl('group','show',array('id'=>$strGroup['groupid']))}">{$strGroup['groupname']}</a>{else}广播{/if}</li>
</ol>

<div class="row">



<div class="col-md-8">


  <div class="panel panel-default">
    <div class="panel-body">

      <div class="article_list">
        <ul>
          {loop $arrArticle $key $item}
          <li>

            <!--
          {if $item['photo']}
          <a href="{tsUrl('article','show',array('id'=>$item[articleid]))}">
          <img style="float:left;" src="{php echo tsXimg($item['photo'],'article',180,140,$item['path'],'1')}" />
          </a>
          {/if}
          -->
            <div class="userimg"><a href="{tsUrl('user','duty',array('id'=>$item[user][userid]))}"><img class="img-rounded" src="{$item[user][face]}" width="32" height="32" alt="{$item['user']['username']}" title="{$item['user']['username']}" /></a></div>
            <div class="article_title" style="font-size: 14px"><a href="{tsUrl('article','show',array('id'=>$item[articleid]))}{$mylink}" style="color: #444444">{$item[title]}</a>            {if $item[istop]=='1'}
              <i style="color: #999999" class="fa fa-arrow-circle-o-up"></i>
              {/if}</div>

            <div class="article_info"><span style="float: left"><a href="{tsUrl('user','duty',array('id'=>$item[user][userid]))}">{$item[user][username]}</a>  {php echo getTime($item[addtime],time())}</span><span style="float: right">  {$item['count_view']}阅 |   {$item['count_comment']}评</span></div>
            <div class="article_content" style="padding-top: 10px" onclick="jump('{php echo(tsUrl('article','show',array('id'=>$item[articleid])))}')">{$item['abs']}</div>
            <div style="{if isMobile()}display:flex;justify-content:space-between;{else}float:right;{/if}padding-top: 5px">
              {if $TS_USER[isadmin]==1||$item['userid']==$TS_USER['userid']}

              <a class="btn btn-w" style="width: 65px"  href="{SITE_URL}index.php?app=article&ac=edit&articleid={$item[articleid]}">修改</a>
              <a class="btn btn-w" style="width: 65px"  href="{SITE_URL}index.php?app=article&ac=delete&articleid={$item[articleid]}&token={$_SESSION['token']}"  onClick="return confirm('确定删除吗?')">删除</a>

              {/if}
              {if $TS_USER[isadmin]==1}
              <a class="btn btn-w" style="width: 65px"  href="javascript:void('0');" onclick="tsPost('index.php?app=group&ac=ajax&ts=isdes&js=1',{'articleid':'{$item['articleid']}'})">{if $item['isdes']}取消描述{else}设为描述{/if}</a>

              <a class="btn btn-w" style="width: 65px"  href="{SITE_URL}index.php?app=group&ac=do&ts=article_istop&articleid={$item[articleid]}">{if $item[istop]=='0'}置顶{else}解置{/if}</a>

              {/if}
            </div>
            <div class="clear"></div>
          </li>
          {/loop}
        </ul>
      </div>

<div class="page">{$pageUrl}</div>
</div>
</div>


</div>



<div class="col-md-4">


    <a class="btn btn-info btn-block btn-lg" href="{tsUrl('article','add',array('groupid'=>$groupid))}">
        <span class="glyphicon glyphicon-plus-sign"></span> 写文档</a>
    <p></p>


  <div class="panel panel-default">
    <div class="panel-heading">分组</div>
    <div class="panel-body">

      <select onchange="jumpto(this.options[this.options.selectedIndex].value)" name="groupid" id="groupid" class="form-control">
        <option value="">选择小组</option>
        {loop $arrGroup $key $item}
        <option value="{$item['groupid']}" {if $item['groupid']==$groupid}selected{/if}>{$item['groupname']}</option>
        {/loop}
      </select>
      <!--
  {loop $arrGroup $key $item}
  <a class="btn {if $item['groupid']==$groupid}btn-success{else}btn-link{/if}" href="{tsUrl('article','group',array('id'=>$item['groupid']))}">{$item['groupname']}</a>
  {/loop}
  -->


</div>

</div>





<!--广告位-->
{php doAction('gobad','300')}


</div>





</div>
</div>

<script>
  function jumpto(groupid){
    var url = '{SITE_URL}index.php?app=article&ac=group&groupid='+groupid;
    window.location.href=url;
  }
</script>

{template footer}